<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/jquery-1.8.3.min.js" type="text/javascript"></script>
    <script src="../js/ajaxfileupload.js" type="text/javascript"></script>
    <script type="text/javascript">
        function fileupload(){
            $.ajaxFileUpload({
                url:'../webmsg/logo', //用于文件上传的服务器端请求地址
                fileElementId:'fileid', //文件上传域的ID
                dataType: 'json', //返回值类型 一般设置为json
                success: function (data) {
                    console.log(data);
                    var filename=window.sessionStorage.setItem("filename",data.data.logoName);
                    var id=window.sessionStorage.setItem("id",data.data.id);
                    location.assign("index.html");
                }
            })
        }
    </script>
</head>
<body>
<input type="file" name="filename" accept=".jpg,.png" id="fileid">
<input type="button" value="上传logo" onclick="fileupload()">
</body>
</html>